#include <iostream>
#include <string>
#include <vector>
#include <assert.h>
#include <string.h>

using namespace std;

#include "string.hpp"

//void test1()
//{
//	//my_string::string s1;
//	//cout << s1.c_str() << endl;
//	//my_string::string s2("hello world");
//	//cout << s2.c_str() << endl;
//
//	string s1("hello world");
//	cout << s1.size() << endl;
//	s1 += '\0';
//	s1 += "hello";
//	cout << s1.size() << endl;
//	cout << s1;
//}

void test1()
{
	my_string::string s1;
	cout << s1 << endl;

	cin >> s1;
	cout << s1 << endl;
}

void test2()
{
	my_string::string s("hello world");
	cout << s << endl;
	s += '\0';
	s += "llll";
	cout << s << endl;

	s.append("helloxxxxxxxxxxxxxxxx");
	cout << s << endl;

	cout << "---------------" << endl;
	my_string::string s1(s);
	cout << s1 << endl;

	my_string::string s2 = s1.substr(3, 2);
	cout << s2 << endl;
}

void test3()
{
	my_string::string s("hello world");

	cout << s << endl;
	s.insert(7, 'x', 3);
	cout << s << endl;

	s.insert(0, 'x', 3);
	cout << s << endl;

	my_string::string s2("##########");
	s.insert(3, s2);
	cout << s << endl;
}

void test4()
{
	my_string::string s1("hello world!!!");
	cout << s1 << endl;
	s1.insert(2, 'x', 5);
	cout << s1 << endl;
	s1.erase(2, 5);
	cout << s1 << endl;
	s1.erase(2);
	cout << s1 << endl;
}

int main()
{
	////cout << "nishishabi" << endl;

	//string s1("nishizhuma");

	//cout << s1 << endl;

	//test1();

	//test1();

	//test2();
	//test3();

	test4();

	//string s;
	//cin >> s;
	//cout << s << endl;

	return 0;
}
